raar.world.factory
Class RAWorldObjectFactory

java.lang.Object
  extended by raar.world.factory.RAWorldObjectFactory

public class RAWorldObjectFactory
extends java.lang.Object

A static factory that manages the RAWorldClass -> RAWorldObject connection in such a way that it is not necessary to have the RAWorldClass object accessible outside the package raar.world.factory.


Constructor Summary
RAWorldObjectFactory()
           
 
Method Summary
static RAWorldObject[] createObject(java.util.Vector classes, java.lang.String className, java.lang.String name, java.awt.geom.Rectangle2D.Double bounds, double rotation)
          Create one or more world objects based on the classes given, the classname, and the position and rotation for this specific instance, if applicable.
static java.awt.Color getClassColor(java.lang.String className, java.util.Vector classes)
          Return the colour for the class given.
static java.util.Vector getClassNames(java.util.Vector objclasses)
          Return a class name for the object given - will work iff the objects in the Vector are all of class RAWorldClass.
static java.awt.Dimension getClassSize(java.lang.String className, java.util.Vector classes)
          Return the size for the fixed size class given.
static java.util.Vector getFactoryObjectNames(java.util.Vector objclasses)
          Return class names in this Vector of classes that are usable by a Factory actor (i.e. an agent can create or destroy objects of this type).
static java.util.Vector getFactoryObjects(java.util.Vector objclasses, java.util.Vector objects)
          Return objects in the objects vector that are potentially produced by a factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RAWorldObjectFactory

public RAWorldObjectFactory()
Method Detail

getClassNames

public static java.util.Vector getClassNames(java.util.Vector objclasses)
                                      throws java.lang.ClassCastException
Return a class name for the object given - will work iff the objects in the Vector are all of class RAWorldClass.

Throws:
java.lang.ClassCastException

getClassColor

public static java.awt.Color getClassColor(java.lang.String className,
                                           java.util.Vector classes)
                                    throws java.lang.ClassNotFoundException
Return the colour for the class given.

Throws:
java.lang.ClassNotFoundException

getClassSize

public static java.awt.Dimension getClassSize(java.lang.String className,
                                              java.util.Vector classes)
                                       throws java.lang.ClassNotFoundException
Return the size for the fixed size class given.

Throws:
java.lang.ClassNotFoundException

getFactoryObjectNames

public static java.util.Vector getFactoryObjectNames(java.util.Vector objclasses)
Return class names in this Vector of classes that are usable by a Factory actor (i.e. an agent can create or destroy objects of this type).


getFactoryObjects

public static java.util.Vector getFactoryObjects(java.util.Vector objclasses,
                                                 java.util.Vector objects)
Return objects in the objects vector that are potentially produced by a factory.


createObject

public static RAWorldObject[] createObject(java.util.Vector classes,
                                           java.lang.String className,
                                           java.lang.String name,
                                           java.awt.geom.Rectangle2D.Double bounds,
                                           double rotation)
                                    throws java.lang.ClassNotFoundException
Create one or more world objects based on the classes given, the classname, and the position and rotation for this specific instance, if applicable.

Throws:
java.lang.ClassNotFoundException